import Yssoa from "./yssoa";
import { Router } from "./yssoa/middleware/Router";
import "./middleware";
import "./routes";
// function MockBuildTool(item: IMockObject): void {
//   Mock.mock(item.rurl, item.rtype, item.template);
// }
//

export class SimServer {
  private app: Yssoa;

  constructor() {
    this.app = Yssoa.instance();

    this.app.use(Router.instance().routes());
  }

  public Run() {
    this.app.startProxy();
  }

  public Stop() {
    this.app.stopProxy();
  }
}

function Init() {
  new SimServer().Run();
}

// 导入所有的 mock 配置
// 这一部分应该由数据设计人员开发
export default Init;
